package com.lanju.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name="vacantperiod")
public class VacantPeriod implements Serializable{
	
	private static final long serialVersionUID = -1600219019264329257L;
	
	private String vid;
	
	private Date startTime;
	
	private Date endTime;
	
	private Contract contract;

	@Id
	@Column(name="vid",unique=true,nullable=false)
	public String getVid() {
		return vid;
	}

	public void setVid(String vid) {
		this.vid = vid;
	}
	@Column(name="startTime")
	public Date getStartTime() {
		return startTime;
	}

	public void setStartTime(Date startTime) {
		this.startTime = startTime;
	}
	@Column(name="endTime")
	public Date getEndTime() {
		return endTime;
	}

	public void setEndTime(Date endTime) {
		this.endTime = endTime;
	}
	 @JsonIgnore
	 @ManyToOne(fetch=FetchType.LAZY)
	 @JoinColumn(name="contractId", nullable=false)
	public Contract getContract() {
		return contract;
	}

	public void setContract(Contract contract) {
		this.contract = contract;
	}
	
	
	

}
